home *** CD-ROM | disk | FTP | other *** search
/ X User Tools / X User Tools (O'Reilly and Associates)(1994).ISO / sources / xman / tkfuncs.c < prev    next >
C/C++ Source or Header  |  1994-09-27  |  2KB  |  91 lines

  1. /*
  2.  * xman - X window system manual page display program.
  3.  *
  4.  * $XConsortium: tkfuncs.c,v 1.5 91/01/09 17:31:46 rws Exp $
  5.  *
  6.  * Copyright 1987, 1988 Massachusetts Institute of Technology
  7.  *
  8.  * Permission to use, copy, modify, and distribute this software and its
  9.  * documentation for any purpose and without fee is hereby granted, provided
  10.  * that the above copyright notice appear in all copies and that both that
  11.  * copyright notice and this permission notice appear in supporting
  12.  * documentation, and that the name of M.I.T. not be used in advertising or
  13.  * publicity pertaining to distribution of the software without specific,
  14.  * written prior permission.  M.I.T. makes no representations about the
  15.  * suitability of this software for any purpose.  It is provided "as is"
  16.  * without express or implied warranty.
  17.  *
  18.  * Author:    Chris D. Peterson, MIT Project Athena
  19.  * Created:   February 6, 1988
  20.  */
  21.  
  22. #include <X11/X.h>
  23. #include <X11/Xos.h>
  24. #include <X11/Xlib.h>
  25. #include <X11/Intrinsic.h>
  26. #include <X11/StringDefs.h>
  27. #include <X11/IntrinsicP.h>
  28.  
  29. /* 
  30.  * I am doing the "wrong" thing here by looking in the core field for the
  31.  * widget to get this info, the "right" thing to do is to do a XtGetValues
  32.  * to get this information.
  33.  */
  34.  
  35. /*    Function Name: Width
  36.  *    Description: finds the width of a widget.
  37.  *    Arguments: w - the widget.
  38.  *    Returns: the width of that widget.
  39.  */
  40.  
  41. int
  42. Width(w)
  43. Widget w;
  44. {
  45.   return( (int) w->core.width );
  46. }
  47.  
  48. /*    Function Name: Height
  49.  *    Description: finds the height of a widget.
  50.  *    Arguments: w - the widget.
  51.  *    Returns: the height of that widget.
  52.  */
  53.  
  54. int
  55. Height(w)
  56. Widget w;
  57. {
  58.   return( (int) w->core.height );
  59. }
  60.  
  61. /*    Function Name: BorderWidth
  62.  *    Description: finds the BorderWidth of a widget.
  63.  *    Arguments: w - the widget.
  64.  *    Returns: the BorderWidth of that widget.
  65.  */
  66.  
  67. int
  68. BorderWidth(w)
  69. Widget w;
  70. {
  71.   return( (int) w->core.border_width );
  72. }
  73.  
  74. /* 
  75.  * These functions have got to be able to get at the widget tree, I don't see
  76.  * any way around this one.
  77.  */
  78.  
  79. /*    Function Name: Name
  80.  *    Description: This function returns the correct popup child
  81.  *    Arguments: w - widget
  82.  *    Returns: the popup child.
  83.  */
  84.  
  85. char * 
  86. Name(w)
  87. Widget w;
  88. {
  89.   return( w->core.name);
  90. }
  91.